package com.itheima.tlias84.controller;

import com.itheima.tlias84.service.LogService;
import com.itheima.tlias84.utils.ResultUtil;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Objects;

@RestController
@RequestMapping("/log")
public class LogController {
    @Resource
    LogService service;

    @GetMapping("/page")
    public ResultUtil selectLogByPage(Integer page, Integer pageSize) {
        //校验参数
        if (Objects.isNull(page)|| Objects.isNull(pageSize)){
            return ResultUtil.fail("分页参数不存在");
        }
        ResultUtil logAll = service.selectLogAll(page, pageSize);
        return logAll;
    }
}

